home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
textUndo.subproj
/
WholeTextChange.m
< prev
Wrap
Text File
|
1992-02-09
|
1KB
|
45 lines
#import "textundo.h"
@implementation WholeTextChange
/*
* This is another variant of a TextSelChange which always records the entire
* contents of the text object. This is useful when a particular kind of
* change isn't restricted to the current selection. Examples include ruler
* changes for tabs and margins, and characters entered from the keyboard.
*/
- saveBeforeChange
{
NXSelPt start, end;
[textView getSel:&start :&end];
oldSel = [[[CutSelection alloc] initText:textView
start:0
end:[textView textLength]] capture];
[oldSel setVisible:start.cp :end.cp];
return self;
}
- saveAfterChange
{
NXSelPt start, end;
[textView getSel:&start :&end];
newSel = [[[CutSelection alloc] initText:textView
start:0
end:[textView textLength]] capture];
[newSel setVisible:start.cp :end.cp];
return self;
}
- setStart:(int)start end:(int)end
{
[newSel setVisible:start :end];
return self;
}
@end